package aqua.smile.p6spy;

import aqua.smile.api.entity.CoreApp;
import aqua.smile.api.service.CoreAppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.List;

@Component
public class Test {

    @Autowired
    private CoreAppService appService;

    @PostConstruct
    public void test() {

        CoreApp app = appService.getById("1");

        List<CoreApp> list = appService.list();

        Long pkId = -2L;
        appService.save(
                new CoreApp()
                        .setPkId(pkId)
                        .setAcId(-2L)
                        .setAppName("xx")
        );
        appService.updateById(
                new CoreApp()
                        .setPkId(pkId)
                        .setAppName("123412")
        );
        appService.removeById(pkId);

        System.out.println("---");
    }

}
